<div id="footer-top">
    <div id="footer-top-inner" class="container">
        <div class="row">
            <div class="widget properties span3">
                
                <?php if(!empty($flats)) { ?>
                <div class="title">
                    <h2>Мы рекомендуем</h2>
                </div><!-- /.title -->

                <div class="content">
                    <?php foreach($flats as $flat) { ?>
                    <div class="property">
                        <div class="image">
                            <a href="<?= $flat->сity->url . "/" . $flat->id; ?>"></a>
                            <?= ImageResizer::getThumb($flat->img0, 'data/imgs/flat/' . $flat->id . '/', $flat->img0, 100, 74) ?>
                        </div><!-- /.image -->
                        <div class="wrapper">
                            <div class="title">
                                <h3>
                                    <a href="<?= $flat->сity->url . "/" . $flat->id; ?>"><?= $flat->street . " " . $flat->home; ?></a>
                                </h3>
                            </div><!-- /.title -->
                            <div class="location"><?= $flat->region->name . ", " . $flat->сity->name; ?></div><!-- /.location -->
                            <div class="price"><?= $flat->getPrice() ?></div><!-- /.price -->
                        </div><!-- /.wrapper -->
                    </div><!-- /.property -->
                    <?php } ?>
                </div><!-- /.content -->
                <?php } ?>
            </div><!-- /.properties-small -->
            
            
            <div class="widget span3">
                <div class="title">
                    <h2>Наши контакты</h2>
                </div><!-- /.title -->

                <div class="content">
                    <table class="contact">
                        <tbody>
                            <tr>
                                <th class="address">Адрес:</th>
                                <td>01001 Киев<br>ул. Крещатик 20</td>
                            </tr>
                            <tr>
                                <th class="phone">Телефон:</th>
                                <td>+38 (063) 373-05-66<br />+38 (066) 032-18-28</td>
                            </tr>
                            <tr>
                                <th class="email">E-mail:</th>
                                <td><a href="mailto:info@flatrent.in.ua">info@flatrent.in.ua</a></td>
                            </tr>
                            <tr>
                                <th class="skype">Skype:</th>
                                <td>flatrent.in.ua</td>
                            </tr>
                        </tbody>
                    </table>
                </div><!-- /.content -->
            </div><!-- /.widget -->

            <div class="widget span3">
                <div class="title">
                    <h2 class="block-title">Полезные ссылки</h2>
                </div><!-- /.title -->

                <div class="content">
                    <ul class="menu nav">
                        <li class="leaf"><a href="/agreement">Пользовательское соглашения</a></li>
                        <li class="leaf"><a href="/rules">Правила и условия</a></li>
                        <li class="first leaf"><a href="/info">Полезная информация</a></li>
                        <li class="leaf"><a href="/faq">Вопросы и ответы</a></li>
<!--                        <li class="leaf"><a href="/info-adv">Реклама на сайте</a></li>-->
                        <li class="leaf"><a href="/site-map">Карта сайта</a></li>
                    </ul>
                </div><!-- /.content -->
            </div><!-- /.widget -->

            <div class="widget span3">
                <div class="title">
                    <h2 class="block-title">Свяжитесь с нами</h2>
                </div><!-- /.title -->

                <div class="content">
                        <?php
                        $form = $this->beginWidget('CActiveForm', array(
                            //'action'=> '/feedback',
                            'id' => 'feedback-form',
                            'enableAjaxValidation' => true,
                            'clientOptions' => array(
                                'validateOnSubmit' => true,
                                'validateOnChange' => false,
                            ),
                        ));
                        ?>
                    
                        <?php if( (!$model->getErrors())&&(!empty($model->name))&&(!empty($model->email))&&(!empty($model->message)) ) { ?>
                            <div class="alert alert-success" style="margin: 0px;w">
                                Ваше сообщение отправленно!
                            </div>
                        <?php } else { ?>
                            
                        <div class="control-group">
                            <label class="control-label" for="inputName">
                                <?php echo strip_tags($form->label($model, 'name')); ?>
                                <span class="form-required" title="This field is required.">*</span>
                            </label>
                            <div class="controls">
                                <?php
                                    echo $form->textField($model, 'name', array(
                                    'id' => 'inputName',
                                    'placeholder' => 'Ваше Имя',
                                    )); ?>
                                <?= $form->error($model,'name'); ?>
                            </div><!-- /.controls -->
                        </div><!-- /.control-group -->

                        <div class="control-group">
                            <label class="control-label" for="inputEmail">
                                <?php echo strip_tags($form->label($model, 'email')); ?>
                                <span class="form-required" title="This field is required.">*</span>
                            </label>
                            <div class="controls">
                                <?php echo $form->textField($model, 'email', array(
                                    'id' => 'inputEmail',
                                    'placeholder' => 'Ваш Еmail',   
                                    'pattern' => '^(\S+)@([a-z0-9-]+)(\.)([a-z]{2,4})(\.?)([a-z]{0,4})+$'
                                    )); ?>
                                <?= $form->error($model,'email'); ?>
                            </div><!-- /.controls -->
                        </div><!-- /.control-group -->

                        <div class="control-group">
                            <label class="control-label" for="inputMessage">
                                <?php echo strip_tags($form->label($model, 'message')); ?>
                                <span class="form-required" title="This field is required.">*</span>
                            </label>

                            <div class="controls">
                                <?php echo $form->textArea($model, 'message', array(
                                    'id' => 'inputMessage',
                                    'placeholder' => 'Ваша Сообщение',
                                    )); ?>
                                <?= $form->error($model,'message'); ?>
                            </div><!-- /.controls -->
                        </div><!-- /.control-group -->

                        <div class="form-actions">
                            <?php echo CHtml::submitButton('Отправить', array('class' => 'btn btn-primary arrow-right')); ?>
                        </div><!-- /.form-actions -->
                        <?php } ?>
                    <?php $this->endWidget(); ?>
                </div><!-- /.content -->
            </div><!-- /.widget -->
        </div><!-- /.row -->
    </div><!-- /#footer-top-inner -->
</div><!-- /#footer-top -->